<?php

/**
 * XistsUser form base class.
 *
 * @package    xists
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseXistsUserForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'username'             => new sfWidgetFormInput(),
      'first_name'           => new sfWidgetFormInput(),
      'last_name'            => new sfWidgetFormInput(),
      'gender'               => new sfWidgetFormInput(),
      'email'                => new sfWidgetFormInput(),
      'passwd'               => new sfWidgetFormInput(),
      'dob'                  => new sfWidgetFormDate(),
      'address1'             => new sfWidgetFormInput(),
      'address2'             => new sfWidgetFormInput(),
      'city'                 => new sfWidgetFormInput(),
      'state'                => new sfWidgetFormInput(),
      'country_id'           => new sfWidgetFormPropelChoice(array('model' => 'XistsCountry', 'add_empty' => false)),
      'zipcode'              => new sfWidgetFormInput(),
      'mobile'               => new sfWidgetFormInput(),
      'passport_no'          => new sfWidgetFormInput(),
      'security_question'    => new sfWidgetFormInput(),
      'security_answer'      => new sfWidgetFormInput(),
      'ref_username'         => new sfWidgetFormInput(),
      'place_under_username' => new sfWidgetFormInput(),
      'join_position'        => new sfWidgetFormInput(),
      'plan_id'              => new sfWidgetFormPropelChoice(array('model' => 'XistsPlan', 'add_empty' => false)),
      'deposit_amount'       => new sfWidgetFormInput(),
      'is_activated'         => new sfWidgetFormInputCheckbox(),
      'join_date'            => new sfWidgetFormDateTime(),
      'plan_expires_at'      => new sfWidgetFormDateTime(),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorPropelChoice(array('model' => 'XistsUser', 'column' => 'id', 'required' => false)),
      'username'             => new sfValidatorString(array('max_length' => 255)),
      'first_name'           => new sfValidatorString(array('max_length' => 255)),
      'last_name'            => new sfValidatorString(array('max_length' => 255)),
      'gender'               => new sfValidatorString(array('max_length' => 255)),
      'email'                => new sfValidatorString(array('max_length' => 255)),
      'passwd'               => new sfValidatorString(array('max_length' => 255)),
      'dob'                  => new sfValidatorDate(),
      'address1'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'address2'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'city'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'state'                => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'country_id'           => new sfValidatorPropelChoice(array('model' => 'XistsCountry', 'column' => 'id')),
      'zipcode'              => new sfValidatorString(array('max_length' => 255)),
      'mobile'               => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'passport_no'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'security_question'    => new sfValidatorString(array('max_length' => 255)),
      'security_answer'      => new sfValidatorString(array('max_length' => 255)),
      'ref_username'         => new sfValidatorString(array('max_length' => 255)),
      'place_under_username' => new sfValidatorString(array('max_length' => 255)),
      'join_position'        => new sfValidatorString(array('max_length' => 255)),
      'plan_id'              => new sfValidatorPropelChoice(array('model' => 'XistsPlan', 'column' => 'id')),
      'deposit_amount'       => new sfValidatorNumber(),
      'is_activated'         => new sfValidatorBoolean(),
      'join_date'            => new sfValidatorDateTime(array('required' => false)),
      'plan_expires_at'      => new sfValidatorDateTime(array('required' => false)),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'updated_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorAnd(array(
        new sfValidatorPropelUnique(array('model' => 'XistsUser', 'column' => array('username'))),
        new sfValidatorPropelUnique(array('model' => 'XistsUser', 'column' => array('email'))),
      ))
    );

    $this->widgetSchema->setNameFormat('xists_user[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'XistsUser';
  }


}
